package com.thor.palmmall.spi.order;

import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.MediaType;

import com.thor.palmmall.spi.common.SOperateInfo;
import com.thor.palmmall.spi.common.SQueryResult;
import com.thor.palmmall.spi.common.SResponse;

/**
 * @author Vergar
 *
 * @since 1.0
 */
@Path("/1/moonstar/order")
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
public interface SOrderService {
	
	@POST
	@Path(value = "/save")
	SResponse<String> save(SOrder order, @QueryParam("") SOperateInfo operInfo);
	
	@GET
	@Path(value = "/{id}")
	SResponse<SOrder> get(@PathParam("id") String id);
	
	@PUT
	@Path(value = "/abort")
	SResponse<String> abort(@QueryParam("id") String id, @QueryParam("version") long version,
			@QueryParam("")SOperateInfo convert);
	@POST
	@Path(value = "/query")
	SResponse<SQueryResult<SOrder>> query(SOrderCondition condition);
}
